﻿using System;
using System.Security.Cryptography.X509Certificates;
using System.Threading;

namespace _044_创建线程
{
    class Program
    {
        static void Main(string[] args)
        {
            Thread 线程 = new Thread(() =>
            {
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine($"正在{Thread.CurrentThread.Name}线程上执行：");
                for (int i = 0; i < 5; i++)
                {
                    Console.Write(i + 1 + "");
                    Thread.Sleep(800);
                }
                Console.Write("\n\n");
                Console.ResetColor();
            });

            线程.Name = "新线程";
            线程.Start();

        }
    }
}
